// var params = getJsParams('macro_image_ctl');

function bindImageCtlEvent(fieldName, w, h) {
	if (w=='') {
		w = "width:130px";
	}
	else {
		w = "width:" + w + "px";
	}
	if (h!='') {
		h = "height:" + h + "px";
	}

  $(fo(fieldName)).change(function() {
    var fieldName = $(this).attr("name");
    var curFile = this.files[0];
    var reader = new FileReader();
    reader.readAsDataURL(curFile);
    reader.onload = function () {
      $(fo(fieldName + 'Img')).html('<img style="margin:5px;' + w + ';' + h + ';" src="'+ reader.result +'"/>');
    }
  });
}